home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / vars.z / vars
Encoding:
Text File  |  1998-10-30  |  1.7 KB  |  67 lines

  1.  
  2.  
  3.  
  4. vvvvaaaarrrrssss((((3333))))                                                                vvvvaaaarrrrssss((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      vars - Perl pragma to predeclare global variable names
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.          use vars qw($frob @mung %seen);
  13.  
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      This will predeclare all the variables whose names are in the list,
  17.      allowing you to use them under "use strict", and disabling any typo
  18.      warnings.
  19.  
  20.      Unlike pragmas that affect the $^H hints variable, the use vars and use
  21.      subs declarations are not BLOCK-scoped.  They are thus effective for the
  22.      entire file in which they appear.  You may not rescind such declarations
  23.      with no vars or no subs.
  24.  
  25.      Packages such as the AAAAuuuuttttooooLLLLooooaaaaddddeeeerrrr and SSSSeeeellllffffLLLLooooaaaaddddeeeerrrr that delay loading of
  26.      subroutines within packages can create problems with package lexicals
  27.      defined using my(). While the vvvvaaaarrrrssss pragma cannot duplicate the effect of
  28.      package lexicals (total transparency outside of the package), it can act
  29.      as an acceptable substitute by pre-declaring global symbols, ensuring
  30.      their availability to the later-loaded routines.
  31.  
  32.      See the section on _P_r_a_g_m_a_t_i_c _M_o_d_u_l_e_s in the _p_e_r_l_m_o_d manpage.
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.